<?php


defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

set_include_path(implode(PATH_SEPARATOR, array(
    APPLICATION_PATH . '/../library/validators',
    APPLICATION_PATH . '/plugins',
    APPLICATION_PATH . '/models',
	APPLICATION_PATH . '/../library/zend/library',
    get_include_path()
)));

require_once 'Zend/Application.php';

$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);



require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);

$translator = new Zend_Translate(
array(
   'adapter' => 'array',
   'content' => '../resources/languages',
   'locale' => 'pl',
   'scan' => Zend_Translate::LOCALE_DIRECTORY
));
Zend_Validate_Abstract::setDefaultTranslator($translator);

Zend_Controller_Front::getInstance()->registerPlugin(new Acl());
Zend_Controller_Front::getInstance()->registerPlugin(new Session());


Zend_Registry::set('config', $application);

$application->bootstrap()->run();

?>
